package cn.sirun.com.fca.personal.center.view.impl;

import android.app.Activity;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.FrameLayout;

import com.tencent.cloud.iov.flow.view.IContentViewContainer;
import com.tencent.cloud.iov.recycler.flow.BaseRecyclerFlowView;
import com.tencent.cloud.iov.util.ResourcesUtils;
import com.tencent.cloud.uikit.ui.widget.IovToolbar;
import com.tencent.cloud.uikit.utils.SystemUiUtils;

import cn.sirun.com.fca.personal.center.R;
import cn.sirun.com.fca.personal.center.presenter.INoticeSettingPresenter;
import cn.sirun.com.fca.personal.center.presenter.impl.NoticeSettingPresenter;
import cn.sirun.com.fca.personal.center.view.INoticeSettingView;

public class NoticeSettingFlowView extends BaseRecyclerFlowView<INoticeSettingPresenter>
        implements INoticeSettingView {

    public NoticeSettingFlowView(Activity activity) {
        super(activity);
    }

    public NoticeSettingFlowView(Activity activity, IContentViewContainer container) {
        super(activity, container);
    }

    @Override
    protected INoticeSettingPresenter createPresenter() {
        return new NoticeSettingPresenter();
    }

    @Override
    protected RecyclerView createRecyclerView() {
        RecyclerView recyclerView = super.createRecyclerView();
        recyclerView.setClipToPadding(false);
        int paddingTop = ResourcesUtils.getDimensionPixelOffset(
                R.dimen.account_layout_margin_top);
        recyclerView.setPadding(0, paddingTop, 0, 0);
        return recyclerView;
    }

    @Override
    protected void attachRecyclerView(View recyclerView) {
        setContentView(R.layout.notice_setting_activity);
        FrameLayout frameLayout = getActivity().findViewById(R.id.notice_stting_container);
        frameLayout.addView(recyclerView);
        setUpActionBar();
    }

    private void setUpActionBar() {
        final Activity activity = getActivity();
        IovToolbar toolbar = SystemUiUtils.showActionBar(activity,
                ResourcesUtils.getString(R.string.notice_setting), ResourcesUtils.getDrawable(R.color.white));
    }

}
